package com.vancouver.knows.ui.fragment.event;

import android.content.Context;
import android.view.View;

import com.pangu.task.mark.ATaskMark;
import com.pangu.ui.refresh.ARefreshViewController;
import com.pangu.ui.refresh.RefreshControllerView;
import com.vancouver.knows.business.BusinessModule;
import com.vancouver.knows.MainApplication;
import com.vancouver.knows.util.AppUtils;

/**
 * 活动下拉界面
 * 
 * @author chenxunlin01
 * 
 */
public class EventPullControllerView extends RefreshControllerView {

	private String type;

	public EventPullControllerView(Context context,String type) {
		super(context);
		this.type = type;
	}

	@Override
	public void onRefresh(ARefreshViewController controller) {
		((EventListView) content).handleRefreshLoadItem();
	}

	public void flush() {
		((EventListView) content).notifyDataSetChanged();
	}

	@Override
	protected View createContentView() {
		return new EventListView(getContext(), this);
	}

	public void loadData(){
		((EventListView) content).setType(type);
		BusinessModule bModule = ((MainApplication) imContext).getBusinessModule();
		((EventListView) content).initLoadableView(bModule.getTaskMarkPool().getFetchEventsTaskMark());
	}

}
